<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新建店铺</title>
<body class="withvernav">
<div class="bodywrapper">
 {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent">
    
        <div class="pageheader notab">
            <h1 class="pagetitle">新建店铺</h1>
            <span class="pagedesc"></span>
            
        </div><!--pageheader-->
        <div id="contentwrapper" class="contentwrapper">
        	
        	<div id="basicform" class="subcontent">
           
					<form class="stdform stdform2" method="post" action="/management/doShopsAuth">
                    	<p>
                        	<label>店铺名称 *</label>
                            <span class="field"><input type="text" name="name" id="name" value="" class="longinput" /></span>
                        </p>
                        <p>
                        	<label>负责人</label>
                            <span class="field">
                            <select name="updateoper" id="updateoper"  class="selection select2_group" style="width:200px;" >
                             <option value="999999" >请选择</option>
                               {{foreach from=$userlist item=li key=key}}
                              	
                                 	  <option value="{{$li.name}}" {{if $li.name == $detail.updateoper}} selected{{/if}} >{{$li.name}}</option>
                                
                               {{/foreach}}
                            </select>
                            </span>
                        </p>
                        <p style="display:none">
                        	<label>描述</label>
                            <span class="field"><textarea cols="80" rows="5" name="descr" id="descr" class="longinput"></textarea></span>
                        </p>
                        <p>
                        	<label>对应平台</label>
                            <span class="field">  <select name="platformID" id="platformID" class="selection" style="width:100px;">
                            <option value="" >请选择</option>
                            {{foreach from=$platform item=li key=_key}}
                            <option value="{{$li.id}}" {{if $li.id==$detail.platfrom}} selected{{/if}}>{{$li.name}}</option>
                            {{/foreach}}
                        </select></span>
                        </p>
                        <p>
                        	<label>对应国家</label>
                            <span class="field">  
                          <select name="countryID" id="countryID" class="selection" style="width:100px;">
                            <option value="" >请选择</option>
                            
                            {{foreach from=$shopgroup item=li key=_key}}
                            	<option value="{{$_key}}" {{if $_key==$detail.country}} selected{{/if}}>{{$li}}</option>
                            {{/foreach}}
                           
                        </select></span>
                        </p>


                        <p class="stdformbutton">
                        	<button type="button" class="submit radius2" onClick="saveform()">确定增加</button>&nbsp;&nbsp;&nbsp;
                             <button type="button" class="submit radius2" onClick="javascript:history.back();"  />返回</button>
                        </p>

                    </form>
					
                    <br />

            </div><!--subcontent-->
            
        
        </div><!--contentwrapper-->
        
	</div><!-- centercontent -->
    
    
</div><!--bodywrapper-->

</body>
<script language="javascript">
function saveform()
{
	if($("#name").val()=="")
	{
		alert("店铺名称不能为空！");
		return false;	
	}
	if($("#updateoper").val()=="")
	{
		alert("店铺负责人不能为空！");	
		return false;
	}
	if($("#platformID").val()=="")
	{
		alert("请选择对应平台！");	
		return false;
	}
	
	$.post("/management/ajaxbutton", {"op": "addsaveshop","name":$("#name").val(),"updateoper":$("#updateoper").val(),"platformID":$("#platformID").val(),"descr":$("#descr").val(),"countryID":$("#countryID").val()},
		function(data){
			if(data==200)
			{
				document.location.href = "/management/setshop";
			}
		},"json"); 
}
</script>
</html>
